/* vue */
import { defineComponent } from "vue";
/* mixin */
import VersionControlBaseMixin from '@src/mixins/versionControlMixin/base';
/* version task */
import {
  isBasicEditionHideCallCenter,
  isBasicEditionHidePlanWork,
  isBasicEditionHidePrintTask,
  isBasicEditionHideServiceReport,
  isBasicEditionHideSubscribe,
  isShowBatchSendingServiceReports,
  isShowCardWorkTime,
  isShowTaskPlanTask,
  isShowTaskModule,
  isShowTaskServiceReport
} from '@shb-lib/version'
import { isFalsy } from "@src/util/type";

export default defineComponent({
  name: "version-control-task-mixin",
  mixins: [VersionControlBaseMixin],
  computed: {
    /** 
     * @description 工单模块版本控制
    */
    taskVersionControl(): Record<string, boolean> {
      return {
        isShowTaskModule: isShowTaskModule(this._versionControlMap),
        isNotShowTaskModule: isFalsy(isShowTaskModule(this._versionControlMap)),
        isBasicEditionHideCallCenter: isBasicEditionHideCallCenter(),
        isBasicEditionHidePlanWork: isBasicEditionHidePlanWork(),
        isBasicEditionHidePrintTask: isBasicEditionHidePrintTask(),
        isBasicEditionHideServiceReport: isBasicEditionHideServiceReport(),
        isBasicEditionHideSubscribe: isBasicEditionHideSubscribe(),
        isShowBatchSendingServiceReports: isShowBatchSendingServiceReports(this._versionControlMap),
        isShowCardWorkTime: isShowCardWorkTime(this._versionControlMap),
        isShowTaskPlanTask: isShowTaskPlanTask(this._versionControlMap),
        isShowTaskServiceReport: isShowTaskServiceReport(this._versionControlMap)
      }
    },
    _isShowTaskModule(): boolean {
      return this.taskVersionControl.isShowTaskModule
    },
    _isNotShowTaskModule(): boolean {
      return this.taskVersionControl.isNotShowTaskModule
    },
    _isBasicEditionHideCallCenter(): boolean {
      return this.taskVersionControl.isBasicEditionHideCallCenter
    },
    _isBasicEditionHidePlanWork(): boolean {
      return this.taskVersionControl.isBasicEditionHidePlanWork
    },
    _isBasicEditionHidePrintTask(): boolean {
      return this.taskVersionControl.isBasicEditionHidePrintTask
    },
    _isBasicEditionHideServiceReport(): boolean {
      return this.taskVersionControl.isBasicEditionHideServiceReport
    },
    _isBasicEditionHideSubscribe(): boolean {
      return this.taskVersionControl.isBasicEditionHideSubscribe
    },
    _isShowBatchSendingServiceReports(): boolean {
      return this.taskVersionControl.isShowBatchSendingServiceReports
    },
    _isShowCardWorkTime(): boolean {
      return this.taskVersionControl.isShowCardWorkTime
    },
    _isShowTaskPlanTask(): boolean {
      return this.taskVersionControl.isShowTaskPlanTask
    },
    _isShowTaskServiceReport(): boolean {
      return this.taskVersionControl.isShowTaskServiceReport
    }
  }
})
